<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>WLeoo's Blog</title><meta name="author" content="WLeoo,3049458366@qq.com"><meta name="copyright" content="WLeoo"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="但行善举，莫问前程">
<meta property="og:type" content="website">
<meta property="og:title" content="WLeoo&#39;s Blog">
<meta property="og:url" content="https://gitee.com/WLeoo/wleoo.git/index.html">
<meta property="og:site_name" content="WLeoo&#39;s Blog">
<meta property="og:description" content="但行善举，莫问前程">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/WLeoo/wleoo.git/img/avatar.png">
<meta property="article:author" content="WLeoo">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/WLeoo/wleoo.git/img/avatar.png"><link rel="shortcut icon" href="/WLeoo/"><link rel="canonical" href="https://gitee.com/WLeoo/wleoo.git/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/WLeoo/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/WLeoo/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: {"limitDay":365,"position":"top","messagePrev":"It has been","messageNext":"days since the last update, the content of the article may be outdated."},
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: WLeoo","link":"链接: ","source":"来源: WLeoo's Blog","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'WLeoo\'s Blog',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2022-12-07 07:47:17'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js"></script><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/WLeoo/css/wleoo.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Zfour/Butterfly-card-history/baiduhistory/css/main.css"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.4.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/WLeoo/img/avatar.png" onerror="onerror=null;src='/img/ali.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/WLeoo/archives/"><div class="headline">文章</div><div class="length-num">13</div></a></div><div class="data-item"><a href="/WLeoo/tags/"><div class="headline">标签</div><div class="length-num">17</div></a></div><div class="data-item"><a href="/WLeoo/categories/"><div class="headline">分类</div><div class="length-num">16</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/WLeoo/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/WLeoo/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/WLeoo/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/WLeoo/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/WLeoo/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/WLeoo/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/WLeoo/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/WLeoo/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/WLeoo/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('/WLeoo/img/bg.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/WLeoo/">WLeoo's Blog</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/WLeoo/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/WLeoo/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/WLeoo/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/WLeoo/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa fa-heartbeat"></i><span> 清单</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/WLeoo/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/WLeoo/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/WLeoo/movies/"><i class="fa-fw fas fa-video"></i><span> 电影</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/WLeoo/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/WLeoo/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">WLeoo's Blog</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/WLeoo" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="/WLeoo/3049458366@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/WLeoo/2022/04/16/hello-world/" title="Talk About Me"><img class="post_bg" src="https://s2.loli.net/2022/04/29/65RKekA8oluQLrV.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="Talk About Me"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/04/16/hello-world/" title="Talk About Me">Talk About Me</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">置顶</span><span class="article-meta-separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-04-16T12:46:25.000Z" title="发表于 2022-04-16 20:46:25">2022-04-16</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-05-03T02:02:46.340Z" title="更新于 2022-05-03 10:02:46">2022-05-03</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/WLeoo/">WLeoo</a></span></div><div class="content">关于我

当你看到这句话时，或许我该对你说一句欢迎光临。
若你还有兴趣再往下翻翻，或许我可以和你聊聊我自己。
在我很小的时候，我很痴迷电视剧里的神仙法术。在那个年代的荧幕里，中国玄幻剧影视的特效还虚假得像辣眼的抠图，剧情三观跟着五官跑，辣眼的妆容和浮夸的造型大行其道，恨不得把“我是妖怪”四个字刻在脑门上。可即便如此，我依然被迷得神魂颠倒。我憧憬着自己也有枯木回春的能力，还有飞天遁地的本领。
然而现实是人没有魔法，但是人有浪漫，有渴望。
在《盗梦空间》里有一句话，当佩吉觉得梦境中操纵意思的能力太过惊悚拒绝道姆后，道姆笃定道：
She will be back. Reality is not gonna be enough for her now.
（她会回来的，当现实不足以满足她时。）
当现实不够圆满的时候，我们难免渴望有一种可以改变的力量。如果这个世界不够圆满，那么可不可以制造一个属于我的世界？
在我还是个孩子时，我总是被父母取笑做事三分钟热度，绘画、摄影、写作样样都会一点，样样都不是特别精通。过了很多年以后，我才意识到一件事：我所喜爱的那些事情或许不是突发奇想，他们的背后是有一件共同 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/WLeoo/2022/12/07/OpenEC%EF%BC%9A%E9%9D%A2%E5%90%91%E5%88%86%E5%B8%83%E5%BC%8F%E7%B3%BB%E7%BB%9F%E7%9A%84%E7%BB%9F%E4%B8%80%E5%8F%AF%E9%85%8D%E7%BD%AE%E6%93%A6%E9%99%A4%E7%BC%96%E7%A0%81%E7%AE%A1%E7%90%86/" title="OpenEC：面向分布式系统的统一可配置擦除编码管理"><img class="post_bg" src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070742533.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="OpenEC：面向分布式系统的统一可配置擦除编码管理"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/12/07/OpenEC%EF%BC%9A%E9%9D%A2%E5%90%91%E5%88%86%E5%B8%83%E5%BC%8F%E7%B3%BB%E7%BB%9F%E7%9A%84%E7%BB%9F%E4%B8%80%E5%8F%AF%E9%85%8D%E7%BD%AE%E6%93%A6%E9%99%A4%E7%BC%96%E7%A0%81%E7%AE%A1%E7%90%86/" title="OpenEC：面向分布式系统的统一可配置擦除编码管理">OpenEC：面向分布式系统的统一可配置擦除编码管理</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-12-06T23:41:12.000Z" title="发表于 2022-12-07 07:41:12">2022-12-07</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-12-06T23:43:16.417Z" title="更新于 2022-12-07 07:43:16">2022-12-07</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/WLeoo/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E7%B3%BB%E7%BB%9F/">分布式系统</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/WLeoo/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E7%B3%BB%E7%BB%9F/OpenEC/">OpenEC</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/OpenEC/">OpenEC</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E5%8F%AF%E6%93%A6%E9%99%A4%E7%BC%96%E7%A0%81/">可擦除编码</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E5%88%86%E5%B8%83%E5%BC%8F%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F/">分布式文件系统</a></span></div><div class="content">OpenEC：面向分布式系统的统一可配置擦除编码管理一、研究背景1.什么是擦除编码？​        HDFS为擦除编码(EC)提供了支持，以更有效地存储数据。与默认三个副本机制相比，EC策略可以节省约50%的存储空间
  但不可忽略的是编解码的运算会消耗CPU资源。纠删码的编解码性能对其在HDFS中的应用起着至关重要的作用，如果不利用硬件方面的优化就很难得到理想的性能。英特尔的智能存储加速库（ISA-L）提供了对纠删码编解码的优化，极大的提升了其性能
  纠删码是hadoop3.x新加入的功能，之前的hdfs都是采用副本方式容错，默认情况下，一个文件有3个副本，可以容忍任意2个副本（datanode)不可用，这样提高了数据的可用性，但也带来了2倍的冗余开销。例如3TB的空间，只能存储1TB的有效数据。而纠删码则可以在同等可用性的情况下，节省更多的空间，以RS-6-3-1024K这种纠删码策略为例子,6份原始数据，编码后生成3份校验数据，一共9份数据，只要最终有6份数据存在，就可以得到原始数据，它可以容忍任意3份数据不可用.
2.目前主流使用的方案：R-S编码RS code是基于有限域 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E5%9B%9B%EF%BC%89%EF%BC%9AWAL-Practice/" title="RocksDB（四）：WAL Practice"><img class="post_bg" src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070733489.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="RocksDB（四）：WAL Practice"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E5%9B%9B%EF%BC%89%EF%BC%9AWAL-Practice/" title="RocksDB（四）：WAL Practice">RocksDB（四）：WAL Practice</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-12-06T20:58:44.000Z" title="发表于 2022-12-07 04:58:44">2022-12-07</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-12-06T23:46:22.770Z" title="更新于 2022-12-07 07:46:22">2022-12-07</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/WLeoo/categories/RocksDB/">RocksDB</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/WLeoo/categories/RocksDB/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/RocksDB/">RocksDB</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></span></div><div class="content">WAL Practice在上一篇里已经完成了对于WAL的理论的学习，接下来让我们对于RocksDB中的WAL进行实际操作一番。
Tools for WAL我是在ubuntu上安装的RocksDB，我采用的编辑器是Clion。如果是在标准的linux操作系统，编译好RocksDB代码后会有一个ldb工具，可以用于查看WAL。这里具体对于ldb不介绍，之前已介绍过RocksDB相关工具的使用。

Create WAL创建WAL一共有两种情况：

当一个新的数据库被打开
当一个列族被flush

Open DB首先当一个新的DB被打开时，就会创建一个WAL。
1s &#x3D; rocksdb::DB::Open(options, &quot;.&#x2F;db&#x2F;&quot;, &amp;db);

下面我们对源码进行查看。在db_impl_open.cc文件，我们可以看到：DB::Open调用时会传入列族（column_families，以下可能简称CF）：
12345678Status DB::Open(const DBOptions&amp; db_options, cons ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%B8%89%EF%BC%89%EF%BC%9AWAL-Learning/" title="RocksDB（三）：WAL Learning"><img class="post_bg" src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070729354.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="RocksDB（三）：WAL Learning"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%B8%89%EF%BC%89%EF%BC%9AWAL-Learning/" title="RocksDB（三）：WAL Learning">RocksDB（三）：WAL Learning</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-12-06T20:38:42.000Z" title="发表于 2022-12-07 04:38:42">2022-12-07</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-12-06T23:29:31.437Z" title="更新于 2022-12-07 07:29:31">2022-12-07</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/WLeoo/categories/RocksDB/">RocksDB</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/WLeoo/categories/RocksDB/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/RocksDB/">RocksDB</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></span></div><div class="content">WAL LearningWrite Ahead LogOverview在RocksDB中每一次数据的更新都会涉及到两个结构，一个是内存中的memtable(后续会刷新到磁盘成为SST)，第二个是WAL(WriteAheadLog)。在默认情况下爱，RocksDB通过在每次用户写时调用flush （刷盘）WAL文件来保持一致性。
WAL主要的功能是当RocksDB异常退出后，能够恢复出错前的内存中(memtable)数据，因此RocksDB默认是每次用户写都会刷新数据到WAL。每次当当前WAL对应的内存数据(memtable)刷新到磁盘之后，都会新建一个WAL。
所有的WAL文件都是保存在WAL目录(options.wal_dir)，为了保证数据的状态，所有的WAL文件的名字都是按照顺序的(log_number)。
一个WAL记录着所有列族的写入日志。
Life Cycle of a WAL举个例子，Rocksdb实例创建了两个column families（列族），分别是new_cf和default。一旦有db被打开，就会在磁盘上创建一个WAL来持久化所有的写操作。（WAL在所有列族之 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%BA%8C%EF%BC%89%EF%BC%9AAdministration-and-Data-Access-Tool/" title="RocksDB（二）：Administration and Data Access Tool"><img class="post_bg" src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070727412.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="RocksDB（二）：Administration and Data Access Tool"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%BA%8C%EF%BC%89%EF%BC%9AAdministration-and-Data-Access-Tool/" title="RocksDB（二）：Administration and Data Access Tool">RocksDB（二）：Administration and Data Access Tool</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-12-06T20:32:00.000Z" title="发表于 2022-12-07 04:32:00">2022-12-07</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-12-06T23:31:59.358Z" title="更新于 2022-12-07 07:31:59">2022-12-07</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/WLeoo/categories/RocksDB/">RocksDB</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/WLeoo/categories/RocksDB/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/RocksDB/">RocksDB</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></span></div><div class="content">Administration and Data Access ToolLDB ToolIntroductionldb命令行工具提供多种数据访问和数据库管理命令。下面列出了一些样例。如果需要更多帮助信息，请直接不带参数运行ldb工具，或者运行tools/ldb_test.py内的单元测试。
How to Use如果想要使用ldb工具，可以阅读INSTALL.md并执行如下命令：
1make ldb

Examples数据访问样例：向数据库中添加（a1，b1），ok表示添加成功，其中create_if_missing如果存在则打开，不存在则创建
12$./ldb --db=/tmp/test_db --create_if_missing put a1 b1OK 

在数据库中查询key=a1的value，结果是b1
12$ .&#x2F;ldb --db&#x3D;&#x2F;tmp&#x2F;test_db get a1b1

在数据库中查询key=a2的value，结果是b2
 12$ .&#x2F;ldb --db&#x3D;&#x2F;tmp&#x2F;test_db get a2 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%B8%80%EF%BC%89%EF%BC%9AWhat-is-RocksDB/" title="RocksDB（一）：What is RocksDB"><img class="post_bg" src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070624447.png" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="RocksDB（一）：What is RocksDB"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%B8%80%EF%BC%89%EF%BC%9AWhat-is-RocksDB/" title="RocksDB（一）：What is RocksDB">RocksDB（一）：What is RocksDB</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-12-06T19:23:41.000Z" title="发表于 2022-12-07 03:23:41">2022-12-07</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-12-06T22:28:36.747Z" title="更新于 2022-12-07 06:28:36">2022-12-07</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/WLeoo/categories/RocksDB/">RocksDB</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/WLeoo/categories/RocksDB/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/RocksDB/">RocksDB</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></span></div><div class="content">What’s RocksDB?Preface由于本人毕设所做项目为“面向RocksDB的纠删码的设计与实现”，因此首先对于RocksDB要有一个充分的了解，它是用来做什么的，原理与工作流又是怎样的。以下为学习记录。
ConceptRocksDB是FaceBook起初作为实验性质开发的NOSQL存储系统，旨在充分实现快存上存储数据的服务能力。其设计是基于Google开源的LevelDB，由Facebook的Dhruba Borthakur于2012年4月创建的LevelDB的分支，优化了LevelDB中存在的一些问题，其性能要比LevelDB强，设计与LevelDB极其类似。最初的目标是提高服务工作负载的性能，最大限度的发挥闪存和RAM的高度率读写性能。
RocksDB是一个C++库，可以用于存储KV（key和value是任意字节流），包括任意大小的字节。同时RocksDB还支持原子读写，提供java调用的api，因此可以通过java api对RocksDB数据库进行操作。
RocksDB 具有高度灵活的配置设置，深度支持各种配置，可以调整为在各种生产环境（包括纯内存，闪存，硬盘或 HD ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/WLeoo/2022/07/09/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C%E5%AE%9E%E9%AA%8C%E6%8A%A5%E5%91%8A/" title="IP流量地图实验报告"><img class="post_bg" src="https://s2.loli.net/2022/07/09/brwABYgcUdVeZ3x.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="IP流量地图实验报告"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/07/09/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C%E5%AE%9E%E9%AA%8C%E6%8A%A5%E5%91%8A/" title="IP流量地图实验报告">IP流量地图实验报告</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-07-09T02:35:21.000Z" title="发表于 2022-07-09 10:35:21">2022-07-09</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-07-09T02:48:08.088Z" title="更新于 2022-07-09 10:48:08">2022-07-09</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/WLeoo/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/">计算机网络</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/WLeoo/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/%E5%AE%9E%E9%AA%8C%E6%8A%A5%E5%91%8A/">实验报告</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/">计算机网络</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E5%AE%9E%E9%AA%8C%E6%8A%A5%E5%91%8A/">实验报告</a></span></div><div class="content">计算机网络上机——IP流量地图实验报告一、实验目的掌握IP协议。掌握协议分析编程的编写。分析IP协议，统计流量，可以把流量计做成流量地图，显示不同地点间数据实时发送的量，比如武汉到北京的数据包发送的数据量。 可以用echart画地图，用whois获取IP地址的所属地。
二、实验内容根据IP协议，解析每个数据包的PCI，并对不同IP进行流量统计。

实现的软件能显示每个包的PCI。
能显示每个IP地址的流量，即显示接收包的数量，如有精力，可将其绘制成流量地图。

实验环境：windows11                        开发环境：visual studio 2022+npcap
三、实验原理3.1 网络协议分析原理网络协议分析是截获网络上正在传输的数据报文，并对数据报文的内容进行分析。网络协议分析需要截获网络_上的所有报文，根据上面对网卡接收模式的分析，只要将网卡的接收模式置于混杂模式即可实现。在接收到网络上所有的数据报文后，通过相应的网络协议分析软件进行处理，可以实时分析这些数据的内容，进而分析网络状态和整体布局。网络协议分析技术主要用来帮助网络管理员对网络进行管理。 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/WLeoo/2022/07/08/vue%E7%88%B6%E5%AD%90%E7%BB%84%E4%BB%B6%E4%BC%A0%E5%8F%82/" title="vue父子组件传参"><img class="post_bg" src="https://s2.loli.net/2022/07/08/IKxb7gslJL5wYB2.png" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="vue父子组件传参"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/07/08/vue%E7%88%B6%E5%AD%90%E7%BB%84%E4%BB%B6%E4%BC%A0%E5%8F%82/" title="vue父子组件传参">vue父子组件传参</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-07-08T02:35:21.000Z" title="发表于 2022-07-08 10:35:21">2022-07-08</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-07-08T02:41:44.793Z" title="更新于 2022-07-08 10:41:44">2022-07-08</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/WLeoo/categories/vue/">vue</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/WLeoo/categories/vue/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/vue/">vue</a></span></div><div class="content">vue组件父子传参前言笔者在开发一个前段项目的过程中，在某个界面弹出的弹框内容多且复杂，为了代码的拥有更高的可读性、简洁性与封装性，因此想要引入组件来进行开发。然而网上关于相关封装的讲解实在不够详细，因此特做记录。
父传子父组件在子组件中传参利用的是props
假设我们的父组件为：
1&lt;app&gt;&lt;&#x2F;app&gt;

我们在父组件中嵌套子组件：
123&lt;app&gt;	&lt;child&gt;&lt;&#x2F;child&gt;&lt;&#x2F;app&gt;

假设子组件的内容为：
12345&lt;div&gt;	&lt;p&gt;我是子组件&lt;&#x2F;p&gt;	&lt;p&gt;&#123;&#123;childMessage&#125;&#125;&lt;&#x2F;p&gt;	&lt;button&gt;&lt;&#x2F;button&gt;&lt;&#x2F;div&gt;

我们想将从父组件中获取的内容放置在message的位置上：
在子组件中我们为子组件命名为child，在child中增加props:
1234567ex ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/WLeoo/2022/06/14/resultType%E4%B8%8EparameterType%E7%9A%84%E5%8C%BA%E5%88%AB/" title="resultType和parameterType的区别"><img class="post_bg" src="https://s2.loli.net/2022/06/14/Apq9nQHWxZRueXP.png" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="resultType和parameterType的区别"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/06/14/resultType%E4%B8%8EparameterType%E7%9A%84%E5%8C%BA%E5%88%AB/" title="resultType和parameterType的区别">resultType和parameterType的区别</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-06-14T03:07:25.000Z" title="发表于 2022-06-14 11:07:25">2022-06-14</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-06-14T13:48:17.063Z" title="更新于 2022-06-14 21:48:17">2022-06-14</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/WLeoo/categories/SpringBoot/">SpringBoot</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/WLeoo/categories/SpringBoot/%E9%94%99%E8%AF%AF%E6%97%A5%E5%BF%97/">错误日志</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/SpringBoot/">SpringBoot</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E5%BC%80%E5%8F%91/">开发</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E5%90%8E%E7%AB%AF/">后端</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E9%94%99%E8%AF%AF%E6%97%A5%E5%BF%97/">错误日志</a></span></div><div class="content">resultType和parameterType的区别导言在写mapper.xml文件实现自动绑定mapper的接口时，笔者不慎将findByUserId的resultType错写成parameterType，由于经验不足排查了很久才发现这个细小的手误。同时也产生了好奇，resultType和parameterType究竟有什么区别，它们的用法和差异又体现在何处？经过查阅资料，大致有了了解，以下为笔者的总结。

基本了解Mybatis的Mapper文件中的select,insert,update,delect元素中都有一个    parameterType    和    resultType    属性,    parameterType    属性用于对应的mapper接口方法接受的参数类型,    resultType    用于指定sql输出的结果类型。
resultType:指定sql输出结果类型,总共就两种:

基本数据类型
pojo类类型：mybatis将sql查询结果的一行记录数据映射为resultType指定数据类型的对象，如果有多条数据，则分别进行映射，并把对象放到 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/WLeoo/2022/06/13/SpringBoot%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%E4%B8%80/" title="SpringBoot学习笔记（一）"><img class="post_bg" src="https://s2.loli.net/2022/06/13/pB3OftCZoJYa95c.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="SpringBoot学习笔记（一）"></a></div><div class="recent-post-info"><a class="article-title" href="/WLeoo/2022/06/13/SpringBoot%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%E4%B8%80/" title="SpringBoot学习笔记（一）">SpringBoot学习笔记（一）</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-06-13T03:07:25.000Z" title="发表于 2022-06-13 11:07:25">2022-06-13</time><span class="article-meta-separator">|</span><i class="fas fa-history"></i><span class="article-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-06-14T13:48:02.461Z" title="更新于 2022-06-14 21:48:02">2022-06-14</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/WLeoo/categories/SpringBoot/">SpringBoot</a><i class="fas fa-angle-right article-meta-link"></i><a class="article-meta__categories" href="/WLeoo/categories/SpringBoot/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/WLeoo/tags/SpringBoot/">SpringBoot</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/Maven/">Maven</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E5%BC%80%E5%8F%91/">开发</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/WLeoo/tags/%E5%90%8E%E7%AB%AF/">后端</a></span></div><div class="content">第一章 创建SpringBoot工程概念1.Spring 诞生时是 Java 企业版（Java Enterprise Edition，JEE，也称 J2EE）的轻量级代替品。无需开发重量级的 Enterprise JavaBean（EJB），Spring 为企业级Java 开发提供了一种相对简单的方法，通过依赖注入和面向切面编程，用简单的Java 对象（Plain Old Java Object，POJO）实现了 EJB 的功能。
虽然 Spring 的组件代码是轻量级的，但它的配置却是重量级的。
2.Spring Boot 是简化 Spring 应用开发的一个框架
3.Spring Boot 主要提供了以下的功能：

创建独立的Spring应用程序
嵌入的Tomcat，无需部署WAR文件
简化Maven配置
自动配置Spring
提供生产就绪型功能，如外部配置

创建SpringBoot项目方法一：手动创建注意，这种方法创建工程后，还需要自己配置webapp和resource文件夹
1.Idea 里面 File –&gt; new –&gt; project –&gt; maven  ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/WLeoo/page/2/#content-inner">2</a><a class="extend next" rel="next" href="/WLeoo/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/WLeoo/img/avatar.png" onerror="this.onerror=null;this.src='/WLeoo/img/ali.gif'" alt="avatar"/></div><div class="author-info__name">WLeoo</div><div class="author-info__description">但行善举，莫问前程</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/WLeoo/archives/"><div class="headline">文章</div><div class="length-num">13</div></a></div><div class="card-info-data-item"><a href="/WLeoo/tags/"><div class="headline">标签</div><div class="length-num">17</div></a></div><div class="card-info-data-item"><a href="/WLeoo/categories/"><div class="headline">分类</div><div class="length-num">16</div></a></div></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/WLeoo"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/WLeoo" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="/WLeoo/3049458366@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/WLeoo/2022/12/07/OpenEC%EF%BC%9A%E9%9D%A2%E5%90%91%E5%88%86%E5%B8%83%E5%BC%8F%E7%B3%BB%E7%BB%9F%E7%9A%84%E7%BB%9F%E4%B8%80%E5%8F%AF%E9%85%8D%E7%BD%AE%E6%93%A6%E9%99%A4%E7%BC%96%E7%A0%81%E7%AE%A1%E7%90%86/" title="OpenEC：面向分布式系统的统一可配置擦除编码管理"><img src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070742533.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="OpenEC：面向分布式系统的统一可配置擦除编码管理"/></a><div class="content"><a class="title" href="/WLeoo/2022/12/07/OpenEC%EF%BC%9A%E9%9D%A2%E5%90%91%E5%88%86%E5%B8%83%E5%BC%8F%E7%B3%BB%E7%BB%9F%E7%9A%84%E7%BB%9F%E4%B8%80%E5%8F%AF%E9%85%8D%E7%BD%AE%E6%93%A6%E9%99%A4%E7%BC%96%E7%A0%81%E7%AE%A1%E7%90%86/" title="OpenEC：面向分布式系统的统一可配置擦除编码管理">OpenEC：面向分布式系统的统一可配置擦除编码管理</a><time datetime="2022-12-06T23:41:12.000Z" title="发表于 2022-12-07 07:41:12">2022-12-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E5%9B%9B%EF%BC%89%EF%BC%9AWAL-Practice/" title="RocksDB（四）：WAL Practice"><img src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070733489.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="RocksDB（四）：WAL Practice"/></a><div class="content"><a class="title" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E5%9B%9B%EF%BC%89%EF%BC%9AWAL-Practice/" title="RocksDB（四）：WAL Practice">RocksDB（四）：WAL Practice</a><time datetime="2022-12-06T20:58:44.000Z" title="发表于 2022-12-07 04:58:44">2022-12-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%B8%89%EF%BC%89%EF%BC%9AWAL-Learning/" title="RocksDB（三）：WAL Learning"><img src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070729354.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="RocksDB（三）：WAL Learning"/></a><div class="content"><a class="title" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%B8%89%EF%BC%89%EF%BC%9AWAL-Learning/" title="RocksDB（三）：WAL Learning">RocksDB（三）：WAL Learning</a><time datetime="2022-12-06T20:38:42.000Z" title="发表于 2022-12-07 04:38:42">2022-12-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%BA%8C%EF%BC%89%EF%BC%9AAdministration-and-Data-Access-Tool/" title="RocksDB（二）：Administration and Data Access Tool"><img src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070727412.jpg" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="RocksDB（二）：Administration and Data Access Tool"/></a><div class="content"><a class="title" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%BA%8C%EF%BC%89%EF%BC%9AAdministration-and-Data-Access-Tool/" title="RocksDB（二）：Administration and Data Access Tool">RocksDB（二）：Administration and Data Access Tool</a><time datetime="2022-12-06T20:32:00.000Z" title="发表于 2022-12-07 04:32:00">2022-12-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%B8%80%EF%BC%89%EF%BC%9AWhat-is-RocksDB/" title="RocksDB（一）：What is RocksDB"><img src="https://blog-imgs-1315248452.cos.ap-nanjing.myqcloud.com/images/202212070624447.png" onerror="this.onerror=null;this.src='/WLeoo/img/404.jpg'" alt="RocksDB（一）：What is RocksDB"/></a><div class="content"><a class="title" href="/WLeoo/2022/12/07/RocksDB%EF%BC%88%E4%B8%80%EF%BC%89%EF%BC%9AWhat-is-RocksDB/" title="RocksDB（一）：What is RocksDB">RocksDB（一）：What is RocksDB</a><time datetime="2022-12-06T19:23:41.000Z" title="发表于 2022-12-07 03:23:41">2022-12-07</time></div></div></div></div><div class="card-widget" id="card-newest-comments"><div class="item-headline"><i class="fas fa-comment-dots"></i><span>最新评论</span></div><div class="aside-list"><span>正在加载中...</span></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            <a class="card-more-btn" href="/WLeoo/categories/" title="查看更多">
    <i class="fas fa-angle-right"></i></a>
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/WLeoo/categories/Butterfly/"><span class="card-category-list-name">Butterfly</span><span class="card-category-list-count">1</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/WLeoo/categories/Butterfly/%E7%BE%8E%E5%8C%96/"><span class="card-category-list-name">美化</span><span class="card-category-list-count">1</span></a></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/WLeoo/categories/Markdown/"><span class="card-category-list-name">Markdown</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/WLeoo/categories/RocksDB/"><span class="card-category-list-name">RocksDB</span><span class="card-category-list-count">4</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/WLeoo/categories/RocksDB/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/"><span class="card-category-list-name">学习笔记</span><span class="card-category-list-count">4</span></a></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/WLeoo/categories/SpringBoot/"><span class="card-category-list-name">SpringBoot</span><span class="card-category-list-count">2</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/WLeoo/categories/SpringBoot/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/"><span class="card-category-list-name">学习笔记</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/WLeoo/categories/SpringBoot/%E9%94%99%E8%AF%AF%E6%97%A5%E5%BF%97/"><span class="card-category-list-name">错误日志</span><span class="card-category-list-count">1</span></a></li></ul></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/WLeoo/tags/Butterfly/" style="font-size: 1.1em; color: #999">Butterfly</a> <a href="/WLeoo/tags/Hexo/" style="font-size: 1.1em; color: #999">Hexo</a> <a href="/WLeoo/tags/Markdown/" style="font-size: 1.1em; color: #999">Markdown</a> <a href="/WLeoo/tags/Maven/" style="font-size: 1.1em; color: #999">Maven</a> <a href="/WLeoo/tags/OpenEC/" style="font-size: 1.1em; color: #999">OpenEC</a> <a href="/WLeoo/tags/RocksDB/" style="font-size: 1.37em; color: #99a4b2">RocksDB</a> <a href="/WLeoo/tags/SpringBoot/" style="font-size: 1.23em; color: #999ea6">SpringBoot</a> <a href="/WLeoo/tags/WLeoo/" style="font-size: 1.1em; color: #999">WLeoo</a> <a href="/WLeoo/tags/vue/" style="font-size: 1.1em; color: #999">vue</a> <a href="/WLeoo/tags/%E5%88%86%E5%B8%83%E5%BC%8F%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F/" style="font-size: 1.1em; color: #999">分布式文件系统</a> <a href="/WLeoo/tags/%E5%8F%AF%E6%93%A6%E9%99%A4%E7%BC%96%E7%A0%81/" style="font-size: 1.1em; color: #999">可擦除编码</a> <a href="/WLeoo/tags/%E5%90%8E%E7%AB%AF/" style="font-size: 1.23em; color: #999ea6">后端</a> <a href="/WLeoo/tags/%E5%AE%9E%E9%AA%8C%E6%8A%A5%E5%91%8A/" style="font-size: 1.1em; color: #999">实验报告</a> <a href="/WLeoo/tags/%E5%BC%80%E5%8F%91/" style="font-size: 1.23em; color: #999ea6">开发</a> <a href="/WLeoo/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/" style="font-size: 1.5em; color: #99a9bf">数据库</a> <a href="/WLeoo/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/" style="font-size: 1.1em; color: #999">计算机网络</a> <a href="/WLeoo/tags/%E9%94%99%E8%AF%AF%E6%97%A5%E5%BF%97/" style="font-size: 1.1em; color: #999">错误日志</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/WLeoo/archives/2022/12/"><span class="card-archive-list-date">十二月 2022</span><span class="card-archive-list-count">5</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/WLeoo/archives/2022/07/"><span class="card-archive-list-date">七月 2022</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/WLeoo/archives/2022/06/"><span class="card-archive-list-date">六月 2022</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/WLeoo/archives/2022/05/"><span class="card-archive-list-date">五月 2022</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/WLeoo/archives/2022/04/"><span class="card-archive-list-date">四月 2022</span><span class="card-archive-list-count">2</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">13</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2021-04-06T16:00:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2022-12-06T23:47:17.394Z"></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('/WLeoo/img/bg.png')"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By WLeoo</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my blog!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="chat_btn" type="button" title="rightside.chat_btn"><i class="fas fa-sms"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/WLeoo/js/utils.js"></script><script src="/WLeoo/js/main.js"></script><script src="/WLeoo/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="/WLeoo/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function subtitleType () {
  if (true) { 
    window.typed = new Typed("#subtitle", {
      strings: ["三更有梦书当枕，千里怀人月在峰","山不见我，我自去见山"],
      startDelay: 300,
      typeSpeed: 150,
      loop: true,
      backSpeed: 50
    })
  } else {
    document.getElementById("subtitle").innerHTML = '三更有梦书当枕，千里怀人月在峰'
  }
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}</script></div><script src="https://cdn.jsdelivr.net/npm/blueimp-md5/js/md5.min.js"></script><script>window.addEventListener('load', () => {
  const changeContent = (content) => {
    if (content === '') return content

    content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[图片]') // replace image link
    content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[链接]') // replace url
    content = content.replace(/<pre><code>.*?<\/pre>/gi, '[代码]') // replace code
    content = content.replace(/<[^>]+>/g,"") // remove html tag

    if (content.length > 150) {
      content = content.substring(0,150) + '...'
    }
    return content
  }

  const getIcon = (icon, mail) => {
    if (icon) return icon
    let defaultIcon = '?d=monsterid'
    let iconUrl = `https://gravatar.loli.net/avatar/${md5(mail.toLowerCase()) + defaultIcon}`
    return iconUrl
  }

  const generateHtml = array => {
    let result = ''

    if (array.length) {
      for (let i = 0; i < array.length; i++) {
        result += '<div class=\'aside-list-item\'>'

        if (true) {
          const name = 'src'
          result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
        }

        result += `<div class='content'>
        <a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
        <div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
        </div></div>`
      }
    } else {
      result += '没有评论'
    }

    let $dom = document.querySelector('#card-newest-comments .aside-list')
    $dom.innerHTML= result
    window.lazyLoadInstance && window.lazyLoadInstance.update()
    window.pjax && window.pjax.refresh($dom)
  }

  const getComment = () => {
    const serverURL = 'https://FxBfa6mf.api.lncldglobal.com'

    var settings = {
      "method": "GET",
      "headers": {
        "X-LC-Id": 'FxBfa6mfRNowzptPvsvHni4L-gzGzoHsz',
        "X-LC-Key": '5PkFiNt3LOiRXfEDGFsGov5p',
        "Content-Type": "application/json"
      },
    }

    fetch(`${serverURL}/1.1/classes/Comment?limit=6&order=-createdAt`,settings)
      .then(response => response.json())
      .then(data => {
        const valineArray = data.results.map(function (e) {
          return {
            'avatar': getIcon(e.QQAvatar, e.mail),
            'content': changeContent(e.comment),
            'nick': e.nick,
            'url': e.url + '#' + e.objectId,
            'date': e.updatedAt,
          }
        })
        saveToLocal.set('valine-newest-comments', JSON.stringify(valineArray), 10/(60*24))
        generateHtml(valineArray)
      }).catch(e => {
        const $dom = document.querySelector('#card-newest-comments .aside-list')
        $dom.innerHTML= "无法获取评论，请确认相关配置是否正确"
      }) 
  }

  const newestCommentInit = () => {
    if (document.querySelector('#card-newest-comments .aside-list')) {
      const data = saveToLocal.get('valine-newest-comments')
      if (data) {
        generateHtml(JSON.parse(data))
      } else {
        getComment()
      }
    }
  }

  newestCommentInit()
  document.addEventListener('pjax:complete', newestCommentInit)
})</script><script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/gh/xiabo2/CDN@latest/fishes.js"></script><div class="aplayer no-destroy" data-id="60198" data-server="netease" data-type="playlist" data-fixed="true" data-autoplay="false"> </div><script src="/WLeoo/js/wleoo.js"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --><script data-pjax>function history_calendar_injector_config(){
                var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
                var item_html = '<div class="card-widget card-history"><div class="card-content"><div class="item-headline"><i class="fas fa-clock fa-spin"></i><span>那年今日</span></div><div id="history-baidu" style="height: 100px;overflow: hidden"><div class="history_swiper-container" id="history-container" style="width: 100%;height: 100%"><div class="swiper-wrapper" id="history_container_wrapper" style="height:20px"></div></div></div></div>';
                console.log('已挂载history_calendar')
                // parent_div_git.innerHTML=item_html+parent_div_git.innerHTML // 无报错，但不影响使用(支持pjax跳转)
                parent_div_git.insertAdjacentHTML("afterbegin",item_html) // 有报错，但不影响使用(支持pjax跳转)
            }if( document.getElementsByClassName('sticky_layout')[0] && (location.pathname ==='all'|| 'all' ==='all')){

            history_calendar_injector_config()
        } </script><script data-pjax  src="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.js"></script><script data-pjax src="https://cdn.jsdelivr.net/gh/Zfour/Butterfly-card-history/baiduhistory/js/main.js"></script><!-- hexo injector body_end end --></body></html>